*12-09-24_h10dmrobustness.do

clear
macro drop _all
global filetree /Users/Allan/Dropbox/!!Papers/Liberal Peace/12-02-21_ISQ_commentary/DOR_ISQ_2013_Replication/M_Rep

cd "$filetree"

set more off

use "MM_precise.dta", clear

sort ccode1 ccode2 year
gen specification="NA"
gen specnumber=.
gen n=.
gen h10dmCoefficient=.
gen h10dmSE=.

gen CIElCoefficient=.
gen CIElSE=.
gen h10dmpvalues=.
gen CIElpvalues=.


gen h10dmCIElc=h10dm*CIElc

sort ccode1 ccode2 year
global controls lncprt mjpw cntg dist numstate 

global fmcontrols lncprt mjpw cntg dist numstate fpceyrs fspl1 fspl2 fspl3

global amcontrols lncprt mjpw cntg dist numstate apceyrs aspl1 aspl2 aspl3

local j=0


**M2 with 4 dependent variables x interaction = 8 models
local j=`j'+1
local spec`j' "''"
local covars`j' "mzmidonl CIEl  h10dm 					   $controls midyears*"


local j=`j'+1
local spec`j' "O''"
local covars`j' "mzmidol CIEl  h10dm 					   $controls midyears*"


local j=`j'+1
local spec`j' "F''"
local covars`j' "mzfmidonl CIEl  h10dm 					   $controls fatalyears*"


local j=`j'+1
local spec`j' "FO''"
local covars`j'  "mzfmidol CIEl  h10dm 					   $controls fatalyears*"


local j=`j'+1
local spec`j'  "I''"
local covars`j'  "mzmidonl CIElc  h10dm h10dmCIElc 					   $controls midyears*"


local j=`j'+1
local spec`j'  "OI''"
local covars`j'  "mzmidol CIElc  h10dm 	 h10dmCIElc 				   $controls midyears*"


local j=`j'+1
local spec`j'  "FI''"
local covars`j'  "mzfmidonl CIElc  h10dm 		 h10dmCIElc 			   $controls fatalyears*"


local j=`j'+1
local spec`j'  "FOI''"
local covars`j' "mzfmidol CIElc  h10dm  	h10dmCIElc 				   $controls fatalyears*"



**M2 with DemocracyHigh, with 4 dependent variables x interaction = 8 models
local j=`j'+1
local spec`j' "D''"
local covars`j' "mzmidonl CIEl  h10dm  dmh 					   $controls midyears*"

 
local j=`j'+1
local spec`j'  "OD''"
local covars`j'  "mzmidol CIEl  h10dm  dmh 					   $controls midyears*"


local j=`j'+1
local spec`j'  "FD''"
local covars`j'  "mzfmidonl CIEl  h10dm  dmh					   $controls fatalyears*"

local j=`j'+1
local spec`j'  "FOD''"
local covars`j'  "mzfmidol CIEl  h10dm  dmh					   $controls fatalyears*"



local j=`j'+1
local spec`j'  "ID''"
local covars`j'  "mzmidonl CIElc  h10dm h10dmCIElc 	 dmh 				   $controls midyears*"


local j=`j'+1
local spec`j'  "OID''"
local covars`j'  "mzmidol CIElc  h10dm 	 h10dmCIElc 	 dmh 			   $controls midyears*"


local j=`j'+1
local spec`j'  "FID''"
local covars`j'  "mzfmidonl CIElc  h10dm 		 h10dmCIElc 	 dmh 		   $controls fatalyears*"


local j=`j'+1
local spec`j'  "FOID''"
local covars`j'  "mzfmidol CIElc  h10dm  	h10dmCIElc 	 dmh 			   $controls fatalyears*"




**Estimating Models, Saving Values
forvalues k=1(1)`j' {
logit `covars`k'', cl(ID) nolog
replace n= e(N)   if _n==`k'
replace specification="`spec`k'''" if _n==`k'
replace specnumber=`k' if _n==`k'
replace h10dmCoefficient=_b[h10dm] if _n==`k'
replace h10dmSE=_se[h10dm] if _n==`k'
replace CIElCoefficient=_b[CIEl] if _n==`k'
replace CIElSE=_se[CIEl] if _n==`k'
}
 

replace h10dmpvalues=2*normal(-abs(h10dmCoefficient/h10dmSE))
replace CIElpvalues=2*normal(-abs(CIElCoefficient/CIElSE))
keep specification-CIElpvalues
drop if specnumber==.
saveold "robustnessh10dm.dta", replace





**Analyses with no ln(life insurance) or GDP

clear
macro drop _all
global filetree /Users/Allan/Dropbox/!!Papers/Liberal Peace/12-02-21_ISQ_commentary/DOR_ISQ_2013_Replication/M_Rep


cd "$filetree"

set more off

use "MM_precise.dta", clear

sort ccode1 ccode2 year
gen specification="NA"
gen specnumber=.
gen n=.
gen h10dmCoefficient=.
gen h10dmSE=.

gen CIElCoefficient=.
gen CIElSE=.
gen h10dmpvalues=.
gen CIElpvalues=.

sort ccode1 ccode2 year
global controls lncprt mjpw cntg dist numstate 

global fmcontrols lncprt mjpw cntg dist numstate fpceyrs fspl1 fspl2 fspl3

global amcontrols lncprt mjpw cntg dist numstate apceyrs aspl1 aspl2 aspl3

local j=0

**M1 with 4 dependent variables x DemocracyHigh = 8 models
local j=`j'+1
local spec`j' "n''"
local covars`j' "mzmidonl   h10dm 					   $controls midyears*"

local j=`j'+1
local spec`j' "On''"
local covars`j' "mzmidol   h10dm 					   $controls midyears*"

local j=`j'+1
local spec`j' "Fn''"
local covars`j' "mzfmidonl   h10dm 					   $controls fatalyears*"

local j=`j'+1
local spec`j' "FOn''"
local covars`j' "mzfmidol   h10dm 					   $controls fatalyears*"


local j=`j'+1
local spec`j' "Dn''"
local covars`j' "mzmidonl   h10dm  dmh 					   $controls midyears*"

local j=`j'+1
local spec`j' "ODn''"
local covars`j' "mzmidol   h10dm  dmh 					   $controls midyears*"

local j=`j'+1
local spec`j' "FDn''"
local covars`j' "mzfmidonl   h10dm  dmh 					   $controls fatalyears*"

local j=`j'+1
local spec`j' "FODn''"
local covars`j' "mzfmidol   h10dm  dmh					   $controls fatalyears*"



**Estimating Models, Saving Values
forvalues k=1(1)`j' {
logit `covars`k'', cl(ID) nolog
replace n= e(N)   if _n==`k'
replace specification="`spec`k'''" if _n==`k'
replace specnumber=`k' if _n==`k'
replace h10dmCoefficient=_b[h10dm] if _n==`k'
replace h10dmSE=_se[h10dm] if _n==`k'
*replace CIElCoefficient=_b[CIEl] if _n==`k'
*replace CIElSE=_se[CIEl] if _n==`k'
}
 
replace h10dmpvalues=2*normal(-abs(h10dmCoefficient/h10dmSE))
replace CIElpvalues=2*normal(-abs(CIElCoefficient/CIElSE))
keep specification-CIElpvalues
drop if specnumber==.
saveold "robustnessh10dm2.dta", replace

